﻿#coding=utf-8
from django.conf.urls.defaults import *
from phonesite.views import current_datetime,current_datetimes
from down.models import *
from down.views import *
#from django.contrib import databrowse
#from myapp.models import SomeModel, SomeOtherModel

#databrowse.site.register(SomeModel)
#databrowse.site.register(SomeOtherModel)

urlpatterns = patterns('',
    # Example:
    # (r'^phonesite/', include('phonesite.foo.urls')),

    # Uncomment this for admin:
      (r'^admin/', include('django.contrib.admin.urls')),
      (r'^times/$',current_datetime),
      (r'^times/(\d{1,2})/$',current_datetimes),
      #(r'^databrowse/(.*)', databrowse.site.root),
    #处理静态文件，仅用于开发阶段
      (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {}),
    #网站首页url
      (r'^$',index),
    #下载down的内容页url
      (r'^soft/detail/(?P<id>\d+)/$',down_detail,{'model':Soft,'template':'down/soft_detail.html'}),
      (r'^game/detail/(?P<id>\d+)/$',down_detail,{'model':Game,'template':'down/game_detail.html'}),
      (r'^book/detail/(?P<id>\d+)/$',down_detail,{'model':Book,'template':'down/book_detail.html'}),
    #下载down的列表页url
      (r'^soft/(?P<id>\d+)/$',down_list,{'model':Soft,'cate':SoftCate,'template':'down/soft_list.html'}),
      (r'^game/(?P<id>\d+)/$',down_list,{'model':Game,'cate':GameCate,'template':'down/game_list.html'}),
      (r'^book/(?P<id>\d+)/$',down_list,{'model':Book,'cate':BookCate,'template':'down/book_list.html'}),
      (r'^soft/(?P<id>\d+)/page(?P<page>\d+)/$',down_list,{'model':Soft,'cate':SoftCate,'template':'down/soft_list.html'}),
      (r'^game/(?P<id>\d+)/page(?P<page>\d+)/$',down_list,{'model':Game,'cate':GameCate,'template':'down/game_list.html'}),
      (r'^book/(?P<id>\d+)/page(?P<page>\d+)/$',down_list,{'model':Book,'cate':BookCate,'template':'down/book_list.html'}),
    #下载down的首页url
      (r'^soft/$',down_index,{'model':Soft,'template':'down/soft_index.html'}),
      (r'^game/$',down_index,{'model':Game,'template':'down/game_index.html'}),
      (r'^book/$',down_index,{'model':Book,'template':'down/book_index.html'}),
    #发送Email
      (r'^send_email_page/$',show_email_page),
      (r'^send_email/$',send_email),
      (r'^contact/thanks/$',send_email_thanks),
    #下载文件，下载次数增1
      (r'^down/soft/(?P<id>\d+)/$',down_file_by_id,{'model':Soft}),
      (r'^down/game/(?P<id>\d+)/$',down_file_by_id,{'model':Game}),
      (r'^down/book/(?P<id>\d+)/$',down_file_by_id,{'model':Book}),

      (r'^top/$',show_top,{'cate':SoftCate}),
      (r'^search/$',search),
    #wap站点URL映射
      #(r'^wap/index/$',show_wap_index),
      #(r'^wap/search_soft/$',show_wap_index),
      #(r'^wap/search/$',show_wap_index),
      #(r'^wap/help/bookmark/$',show_wap_bookmark),
      (r'^wap/',include('phonesite.wap.urls')),

    #wap站点URL映射
      (r'^forum/',include('phonesite.forum.urls')),
      
)

